﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SW.EF.Core
{
    public class AutoMapperProvider : IObjectMapperProvider
    {
        public IMappingExpression<TSource, TDestination> Register<TSource, TDestination>()
        {
            return Mapper.CreateMap<TSource, TDestination>();
        }

        public TDestination Resolve<TDestination>(object source)
        {
            return Mapper.Map<TDestination>(source);
        }
    }
}
